import Vue from "vue";
import store from "@/store";

// 自定义按钮指令
export default function hasBtnPermission(Vue) {
  Vue.directive("has", {
    //   必须要加inserted
    inserted: (el, bindings) => {
      if (store.state.user.userInfo.buttons.indexOf(bindings.value) === -1) {
        el.parentNode.removeChild(el);
      }
    },
  });
}
